//      main.c
//      
//      Copyright 2010 root <root@OrignalServer>
//      
//      This program is free software; you can redistribute it and/or modify
//      it under the terms of the GNU General Public License as published by
//      the Free Software Foundation; either version 2 of the License, or
//      (at your option) any later version.
//      
//      This program is distributed in the hope that it will be useful,
//      but WITHOUT ANY WARRANTY; without even the implied warranty of
//      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//      GNU General Public License for more details.
//      
//      You should have received a copy of the GNU General Public License
//      along with this program; if not, write to the Free Software
//      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
//      MA 02110-1301, USA.


#include <glade/glade.h>
#include <gtk/gtk.h>

GtkWidget *entry1;
int main(int argc, char** argv)
{
	GladeXML *gxml;
	GtkWidget *hwin;
	gtk_init(&argc,&argv);
	gxml=glade_xml_new("glade1.glade",NULL,NULL);
	hwin=glade_xml_get_widget(gxml,"hwin");
	entry1=glade_xml_get_widget(gxml,"entry1");
	glade_xml_signal_autoconnect(gxml);
//----------------------------------------------
//----------------------------------------------
	gtk_widget_show_all(hwin);
	gtk_main();
	
	return 0;
}
//GtkWidget *widget,gpointer data
void cb_button1()
{
	GtkWidget *dialog;
	gchar *entry1_text;
	entry1_text=gtk_entry_get_text(GTK_ENTRY(entry1));
	dialog = gtk_message_dialog_new(NULL, 
			GTK_DIALOG_MODAL |GTK_DIALOG_DESTROY_WITH_PARENT,
			GTK_MESSAGE_INFO,
			GTK_BUTTONS_OK,
			entry1_text);
	gtk_dialog_run(GTK_DIALOG(dialog));//显示并运行对话框
	gtk_widget_destroy(dialog);//销毁对话框

}
void cb_button2()
{
	

}
